import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './elementui/elementui.js'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'

// 对axios进行全局配置
Vue.prototype.$http = axios
// 配置基础的url
axios.defaults.baseURL = 'http://127.0.0.1:8889'

// 通过axios拦截器为每次请求都添加一个token
axios.interceptors.request.use(req =>{
	req.headers.Authorization = window.sessionStorage.getItem('token');
	// 放行
	return req;
})

// 导入全局样式表
import './assets/css/global.css'


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
